<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>更新用户</title>
<script type="text/javascript">
	function method01(){
	    //提交前先让<span>显示内容初始值
	    var spannameElement = document.getElementById('usernameerror');
	    spannameElement.innerHTML='<font color="red">* 用户名在6~11位</font>';
	    var spanpasswordElement = document.getElementById('userpassworderror');
	    spanpasswordElement.innerHTML='<font color="red">* 密码在6~8位</font>'
	
	    var usernameElement = document.getElementsByName('user_name');
	    var uesrnamecontent = usernameElement[0].value;
	    if(!(uesrnamecontent!=null&&uesrnamecontent.length>=6&&uesrnamecontent.length<=11)){
	        spannameElement.innerHTML='<font color="red">用户名格式错误！</font>'
	        return false;
	    }
	
	    var userpasswordElement = document.getElementsByName('user_password');
	    var userpasswordcontent = userpasswordElement[0].value;
	    if(!(userpasswordcontent!=null&&userpasswordcontent.length>=6&&userpasswordcontent.length<=8)){
	        spanpasswordElement.innerHTML='<font color="red">密码格式错误！</font>'
	        return false;
	    }
	    return true;
	}
</script>
</head>
<body>
<form  action="${pageContext.request.contextPath}/servlet/updateuserservlet" method='post' onsubmit="return method01()">
		id：<input type='text' name='user_id' readonly='readonly' value=${updateuser.userId }><br>
		用户名：<input type='text' name='user_name' value=${updateuser.userName }>
				<span id="usernameerror"><font color="red">* 用户名在6~11位</font></span><br>
		密码：<input type='password' name='user_password' value=${updateuser.userPassword }>
				<span id="userpassworderror"><font color="red">* 密码在6~8位</font></span><br>
		身份证号：<input type="text" name="user_idcard" value=${updateuser.idcard.idcardNo}><br>
		<select name="select_dept">
			<option value=${updateuser.dept.deptName} >${updateuser.dept.deptName}</option>
			<c:forEach var="dept" items="${deptInfo}">
				<%--<c:if test="${dept.deptName!=updateuser.dept.deptName}">--%>
					<option value=${dept.deptName}>${dept.deptName}</option>
				<%--</c:if>--%>
			</c:forEach>
		</select><br>
		描述：<input type='text' name='user_desc' value=${updateuser.userDesc }><br>
		状态：<input type='radio' name='user_status' value='1'  ${updateuser.userStatus==1?"checked='checked'":"  " }> 启用
			<input type='radio' name='user_status' value='0'  ${updateuser.userStatus==0?"checked='checked'":"  " }> 禁用<br>
		
		<input type='submit' value='更新'><input type='reset' value='清空'>
	</form>




</body>
</html>